package br.com.sgdc.view.action;

import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;

import br.com.sgdc.view.WindowPrincipal;

public class ActionAboutButtonWindowPrincipal implements ActionListener {
	private WindowPrincipal principalPanel;

	public ActionAboutButtonWindowPrincipal(WindowPrincipal principalPanel) {
		this.principalPanel = principalPanel;
	}

	@Override
	public void actionPerformed(ActionEvent event) {
		try {
			if (event.getSource() == principalPanel.aboutMenuItem) {
				File file = new File("resource\\PDF\\about.pdf");

				Desktop.getDesktop().open(file);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
